package java_io.autoclose;

import java.io.BufferedReader;
import java.io.FileReader;
import static java.lang.System.out;

public class readFirstLineFromFile {

	public static void main(String[] args) throws Exception {
		
		try (BufferedReader br = 
				new BufferedReader(
						new FileReader("file.txt"))) {
			
			String line = br.readLine();
			
			out.println(line);
		}

	}

}
